using System;
using System.ServiceModel.Channels;

namespace CoreEx.ServiceModel
{
    /// <summary>
    /// Represents a class that is capable of providing the WCF runtime 
    /// with a <see cref="Binding"/> instance used for communication 
    /// between clients and services.    
    /// </summary>
    /// <remarks>
    /// There is no default implementation of this interface.
    /// </remarks>
    /// <example>
    /// The following example shows how to implement the interface.
    /// <code>
    /// <![CDATA[
    /// [Implements(typeof(IBindingProvider))]
    /// public class WsHttpBindingProvider : IBindingProvider
    /// {
    ///     public Binding CreateBinding(Type serviceType)
    ///     {
    ///         var wsHttpBinding = new WSHttpBinding();
    ///         wsHttpBinding.MaxReceivedMessageSize = int.MaxValue;
    ///         return wsHttpBinding;
    ///     }
    /// }
    /// ]]>
    ///</code>
    ///</example>     
    public interface IBindingProvider
    {
        /// <summary>
        /// Creates an instance of a class that inherits from the <see cref="Binding"/> class.
        /// </summary>
        /// <param name="serviceType">The service type for which to return a <see cref="Binding"/></param>
        /// <param name="uri">The resolved <see cref="Uri"/> for the service.</param>
        /// <returns>An instance of a class that inherits from the <see cref="Binding"/> class.</returns>
        Binding CreateBinding(Type serviceType, Uri uri);
    } 


}